﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>积分商城 -$!config.title - Powered by wemall</title>
<meta name="keywords" content="$!config.keywords" />
<meta name="description" content="$!config.description" />
<meta name="generator" content="wemall 2.0" />
<meta name="author" content="www.wemall.com">
<meta name="copyright" content="wemall Inc. All Rights Reserved">
<link href="$!webPath/resources/style/system/front/default/css/public.css" type="text/css" rel="stylesheet" />
<link href="$!webPath/resources/style/system/front/default/css/integral.css" type="text/css" rel="stylesheet" />
<link href="$!webPath/resources/style/common/css/overlay.css" type="text/css" rel="stylesheet" />
<script src="$!webPath/resources/js/jquery-1.8.3.min.js"></script>
<script src="$!webPath/resources/js/jquery-ui-1.8.21.js"></script>
<script src="$!webPath/resources/js/jquery.shop.common.js"></script>
<script src="$!webPath/resources/js/jquery.validate.min.js"></script>
<script>
jQuery(document).ready(function(){
  jQuery(":radio[name^=addr_id]").click(function(){
    if(jQuery(this).val()=="new"){
	  jQuery("#new_address").show();
	}else{
      jQuery("#new_address").hide();
	}
  });
  //
  jQuery("#theForm").validate({
    rules:{
	  trueName:{required :true},
	  area_id:{required :true},
	  area_info:{required :true},
	  telephone:{required :true},
	  mobile:{required :true}
	 },
	messages:{
	  trueName:{required :"收货人不能为空"},
	  area_id:{required :"请选择详细区域"},
	  area_info:{required :"详细地址不能为空"},
	  telephone:{required :"联系电话不能为空"},
	  mobile:{required :"手机号码不能为空"}	  
	}
  });
  //
  jQuery("select").change(function(){
     var level=jQuery(this).attr("level");
	 var id=jQuery(this).val();
	 if(id!=""){
	  jQuery.post("$!webPath/load_area.htm",{"pid":id},function(data){
	     jQuery("#area"+level).empty();
		  jQuery("#area"+level).append("<option value=''>请选择</option>");
	    jQuery.each(data, function(index,item){
		  jQuery("#area"+level).append("<option value='"+item.id+"'>"+item.areaName+"</option>");
		  jQuery("#area"+level).show();
		});
	  },"json");
	 }else{
	   for(var i=level;i<=3;i++){
	    jQuery("#area"+i).empty();
	    jQuery("#area"+i).hide();
	   }
	 }
  });
  //
 jQuery("#area3").change(function(){
   var id=jQuery(this).val();
   jQuery("#area_id").val(id);
 });
});
</script>
</head>
<body>
$!httpInclude.include("/top.htm")
<div class="main"> $!httpInclude.include("/head.htm")
  $!httpInclude.include("/nav1.htm")
  <div class="index">
    <div class="inte_step">
      <div class="stepcenter"> <span class="inte_step1a"></span> <span class="inte_step2a"></span> <span class="inte_step3"></span> </div>
    </div>
    <div class="integ_transport">
    <form action="$!webPath/integral_exchange3.htm" method="post" id="theForm">
      <div class="trans_left">
        <h1><span class="trans_sp"><i class="transa"></i>收货人地址</span></h1>
        <ul class="trans_ads">
           #foreach($addr in $addrs)
           <li>
            <b>
            <input name="addr_id" type="radio" value="$!addr.id" #if($!velocityCount==1) checked="checked"#end/>
            </b>
            <span class="transad"> $!{addr.area.parent.parent.areaName}$!{addr.area.parent.areaName}$!{addr.area.areaName} $!{addr.area_info}</span><span class="transuser">收货人姓名: $!addr.trueName</span><span class="transtel">电话:$!addr.mobile</span>
            </li>
            #end
          <li class="this"><b>
            <input name="addr_id" type="radio" value="new" />
            </b><span>使用新的收货地址</span></li>
        </ul>
        <div class="transtable" id="new_address" style="display:none;">
          <table width="740" border="0" cellspacing="0" cellpadding="0" class="trans_table">
            <tr>
              <td width="90"><span class="transtab_name"><strong>*</strong>填写真实姓名:</span></td>
              <td>
                <input name="trueName" type="text" id="trueName" size="30" />
             </td>
            </tr>
            <tr>
              <td><span class="transtab_name"><strong>*</strong>所在地区:</span></td>
              <td>
                <select name="area1" id="area1" level="2" style="width:100px;">
                    <option value="" selected="selected">请选择地区</option>
 				  #foreach($area in $areas)
                     <option value="$!area.id">$!area.areaName</option>
				  #end
                   </select>
                    <select name="area2" id="area2" style="display:none;width:60px;" level="3">
                  </select>
                <select name="area3" id="area3" style="display:none;width:60px;" level="4">
                  </select>
                  <input name="area_id" type="hidden" id="area_id"  value=""/>
              </td>
            </tr>
            <tr>
              <td><span class="transtab_name">邮政编码</span></td>
              <td>
                <input name="zip" type="text" id="zip" size="30" />
              </td>
            </tr>
             <tr>
              <td><span class="transtab_name"><strong>*</strong>手机号码:</span></td>
              <td>
                <input name="mobile" type="text" id="mobile" size="30" />
              </td>
            </tr>
            <tr>
              <td><span class="transtab_name"><strong>*</strong>电话号码:</span></td>
              <td>
                <input name="telephone" type="text" id="telephone" size="30" />
              </td>
            </tr>
            <tr>
              <td><span class="transtab_name"><strong>*</strong>详细地址:</span></td>
              <td>
                <input name="area_info" type="text" id="area_info" size="50" />
              </td>
            </tr>
          </table>
        </div>
        <h1><span class="trans_sp"><i class="transb"></i>我要留言</span></h1>
        <div class="trans_text">
          <textarea name="msg" cols="" rows="" id="msg" ></textarea>
        </div>
        <div class="trans_integ">所需总积分:<strong>$!{total_integral}</strong>分,运费：<strong>$!{trans_fee}</strong>元</div>
        <div class="trans_integ"><span class="trans_submit">
          <input name="" type="submit"  value="兑换完成" style="cursor:pointer;"/>
          </span>
          <input name="trans_fee" type="hidden" id="trans_fee" value="$!trans_fee" />
          <input name="integral_order_session" type="hidden" id="integral_order_session" value="$!integral_order_session" />
        </div>
      </div>
      </form>
      <div class="trans_right">
        <h1><span class="trans_sp"><i class="transc"></i>已选礼品</span></h1>
        <ul>
          #foreach($igc in $igcs)
           #if($!igc.goods.ig_goods_img)
             #set($img="$!imageWebServer/$!{igc.goods.ig_goods_img.path}/$!{igc.goods.ig_goods_img.name}_small.$!{igc.goods.ig_goods_img.ext}")
           #else
             #set($img="$!imageWebServer/$!{config.goodsImage.path}/$!{config.goodsImage.name}")
           #end          
          <li><span><a href="$!webPath/integral_view_$!{igc.goods.id}.htm" target="_blank"><img src="$!img" width="65" height="65" /></a></span>
            <h2><a href="$!webPath/integral_view_$!{igc.goods.id}.htm" target="_blank">$!{igc.goods.ig_goods_name}</a></h2>
            <i>$!igc.count个=<strong>$!{igc.integral}分</strong></i></li>
          #end          
        </ul>
      </div>
    </div>
  </div>
  $!httpInclude.include("/footer.htm") </div>
</body>
</html>
